The need for digital computers to communicate to each other and to remotely located computer peripherals has long been felt. Numerous technologies have been designed to meet this need, including the use of modems for establishing long distance links over the analog phone network and the creation of networking technologies which allow computers and peripherals to communicate over a data transmission medium.
Modems are used in pairs to establish communication between two computers, with each modem being attached to the serial port of its local computer as well as connected to the analog telephone network. The serial port is a standard interface port on the computer which allows the computer to pass a serial bit stream of information to a peripheral such a modem or a printer. On UNIX based computers and other multi-user computer systems, this same serial port is used for communication with the terminals which allow users to interact with the computer. As a result, it is a relatively simple matter to utilize a modem to allow a remotely located terminal to communicate with a multi-user computer system over the phone lines.
Because modern multi-user computers are capable of supporting numerous simultaneous users, it is desirable to have a number of serial ports through which terminals can communicate with the computer. Unfortunately, mounting all of the serial ports directly onto the computer can be logistically difficult, since multi-user computers can often support more than fifty terminal connections. As a result, multiplexors have been utilized to combined serial traffic from numerous, internally referenced serial ports into a single communication channel. In this way, only one communication cable needs to be attached to the computer. On the other end of the communication cable is another multiplexing device, which separates the combined data traffic into data for individual serial ports, and then provides the serial ports through which this data can be accessed. This type of multiplexing device, called a ports concentrator, can be used to provide multiple serial ports for terminals in a location remote from the computer. It is even possible to use multiplexing in a system which allows the data on the main communication cable to be transported across phone lines using modems. This allows multiple serial ports to be accessible at great distances from the computer.
Networking technology can also be utilized to allow remote communication between a computer and another computer or peripheral. Networks which connect computers and peripherals within a relatively small area are referred to as Local Area Networks, or LANs. A general purpose network is a communication system utilizing standard hardware and standard communication protocols, and operating in a multi-vendor environment. General purpose network hardware includes LAN technologies like Ethernet and Token Ring. Standard Network protocols include TCP/IP and SPX/IPX.
LANs are generally formed by connecting computers and peripherals together through a transmission medium, and then communicating over the medium by following standardized communication protocols. These protocols set forth such requirements as to how data should be formatted and how data is designated for a particular device. Data cannot be sent over the network without conforming to these protocols.
Application programs on a host operating system generally depend strongly on the Application Program Interfaces (API) for local communication devices provided by the host operating system. This is especially important on systems like UNIX, whose traditional user interface is terminal command line operation.
General purpose networks most often support two types of communication, a connectionless unreliable datagram service and a reliable bi-directional bytesteam connection. The API to both of these services is very different from the serial port API, and in general programs written to run on serial devices (known as TTYs) require an adaptation layer to run correctly.
In the UNIX environment this is generally done with the network protocols Telnet and Rlogin using a virtual TTY device known as a pseudo-tty or PTTY device. PTTY devices are software entities, not hardware entities, that emulate UNIX TTYs well enough that most command line programs will run with them.
It is important to distinguish these PTTYs from genuine TTYs associated with and controlling actual serial port hardware. A PTTY has a slave side and a master side. The slave side of the PTTY is the TTY emulation device, and is used by programs that require the serial port API to function. The master side interfaces to a network program, such as Telnet or Rlogin, that can send data across the network.
The slave side of the PTTY accepts requests to change user options like line editing characters, tab expansion, and other functions done by the line discipline of the local operating system. However it ignores requests to change baud rate, character size, action on received errors and BREAK signals, and the like.
The master side of the PTTY accepts reads, writes, and a very limited set of input output controls (ioctls) to change the way data is passed back and forth between the slave and master devices. Data written to the master side of the PTTY appears as received serial data on the slave side of the PTTY, as though it had been received on a serial port, and is processed as input serial data by the line discipline of the operating system. The data then appears as received data when read from the slave side of the PTTY. Data written to the slave PTTY is likewise processed as serial output data by the UNIX line discipline, after which it can be read on the master side.
Ioctl operations made to the slave side of the PTTY are invisible to the master side, hence it is not possible for the program accessing the master side of the PTTY to detect that these calls have been made. The interface is just not rich enough to support any operations that cannot be done in the line discipline of the local operating system.
It should also be noted that in most implementations, there is not a one-to-one correspondence between physical devices and PTTYS. When a connection is made into a UNIX system by Telnet or Rlogin, these program simply allocate the next available PTTY for the session. Hence from session to session a network user is likely to get different PTTY devices, in no obvious pattern. This makes it difficult or impossible to enforce system security or user options based on pseudo-tty devices. To overcome this to some extent, ad-hoc programs are commonly written by terminal server vendors that can be attached to the master side of a particular PTTY, so that the slave side of that PTTY remains attached to that program and is not periodically reallocated to another use. Such programs can be used for incoming connects and running login programs, but are most often used to simulate dial-out modems, printers, or direct connect serial devices. This use expands the PTTY to other uses than Telnet and Rlogin, but because of their limited emulation of a genuine TTY device, they require varied workarounds and cause continual maintenance and compatibility problems.
Telnet also uses TCP/IP flow control for port data flow control and sends commands in sequence with the data so that commands cannot be processed until the data ahead of them in the data stream have also been processed. As a result, Telnet requires the use of the expedited data feature of TCP/IP to send certain commands such as user requested interrupts. The implementation of this requires that data ahead of the user interrupt be discarded before the interrupt can be processed.
Unfortunately, this procedure can place a tremendous strain on the host computer as well as the network itself. For instance, when typing on a remote terminal connected through the network, each keystroke is processed, sent over the network to the host computer, and then echoed back over the network to the remote terminal. On an Ethernet network, a transmitted character must be transmitted on a 64 byte minimum size message packet and the acknowledge also requires a 64 byte message packet. Thus, two 64-byte packets must be transmitted for each character typed.
In addition, the receiving of the character by the host computer requires a task switch to run the PTTY control software to receive the character, and a task switch back to the PTTY control software to transmit the echo character.
Devices called terminal servers make remote logins, utilizing the TELNET and RLOGIN commands, available to users through a serial port without requiring the users to be logged onto a computer on the network. A user connected to a serial port on the terminal server can use RLOGIN or TELNET to connect to a multi-user computer on the network. A second user on the terminal server could also connect to the same multi-user computer, and thereby establish a second communications link with its own PTTY assigned to it. Connection made by the terminal server through TELNET, RLOGIN and similar procedures of course embody the same disadvantages as connection made using those procedures through a different computer on the network.